Skip to content

fix: add rerank_hybrid_matches to SearchParameters#100

Open
alangmartini wants to merge 2 commits intotypesense:masterfrom
alangmartini:fix/add-rerank-hybrid-matches-to-search-params
Open

fix: add rerank_hybrid_matches to SearchParameters#100
alangmartini wants to merge 2 commits intotypesense:masterfrom
alangmartini:fix/add-rerank-hybrid-matches-to-search-params

Conversation

@alangmartini
Copy link

@alangmartini alangmartini commented Feb 9, 2026

Summary

  • Bug: rerank_hybrid_matches was only available on MultiSearchCollectionParameters, forcing users to use multi_search even for single-collection hybrid search. The Typesense server accepts this parameter on all search endpoints.
  • Fix: Added a spec patch in DownloadSpecsPlugin.groovy that injects the rerank_hybrid_matches boolean property into the SearchParameters schema in the downloaded OpenAPI spec, following the same approach as the existing SynonymItemSchema patch.
  • Tests: Added unit tests verifying that SearchParameters exposes rerankHybridMatches with the correct default (false) and serializes to the expected JSON key rerank_hybrid_matches.

The rerank_hybrid_matches field was only defined on
MultiSearchCollectionParameters in the OpenAPI spec, forcing users to
use multi_search even for single collection hybrid search. The Typesense
server accepts this parameter for all search endpoints.

Add a spec patch in DownloadSpecsPlugin that injects the
rerank_hybrid_matches boolean property into SearchParameters, matching
the existing SynonymItemSchema patching approach.
Verify that SearchParameters exposes rerankHybridMatches with the
correct default value (false) and serializes to the expected JSON key
rerank_hybrid_matches for Typesense server compatibility.
} else {
println('Warning: SynonymItemSchema allOf block not found, skipping patch')
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is monkey patching the actual contents of the API spec, and isn't used anywhere else. I'd avoid this and instead merge typesense/typesense-api-spec#112 first, since it's going to add it regardless.

@alangmartini
Copy link
Author

Since the correct path is fixing the api specs in https://github.com/typesense/typesense-api-spec, im closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants